home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / amiga / programmer / 1450 < prev    next >
Encoding:
Text File  |  1996-08-05  |  2.1 KB  |  102 lines

  1. Path: norconnect.no!not-for-mail
  2. From: kenneth@norconnect.no (Kenneth C. Nilsen)
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: Re: asm code needed to check thecurrent processor ...
  5. Date: 19 Jan 1996 05:40:40 +0100
  6. Organization: NorConnect Internet Services AS
  7. Message-ID: <1771.6592T235T1312@norconnect.no>
  8. References: <4d1j99$fs6@rc1.vub.ac.be>
  9. NNTP-Posting-Host: norconnect.no
  10. X-Newsreader: THOR 2.21 (Amiga;SOUP)
  11.  
  12. >    hi, I'm looking for some asm code to check current processor
  13. >(680x0) available, fpu, mmu on a Amiga.
  14. >    I'f you have some routines ... could you send it to me ...
  15.  
  16. I believe I have answered this before, but here we go again:
  17. (Sources from my dfunc.library (aminet:util/libs/DFunc3714.lha)
  18.  
  19. Usage:    bsr.b    GetProc
  20.     d0=processor
  21.  
  22.  
  23.     include    exec/execbase.i
  24.  
  25. GetProc    move.l    a6,-(sp)        ;GetProc() ()
  26.  
  27.     move.l    $4.w,a6
  28.     move.w    296(a6),d1
  29.  
  30. .060    move.l    #68060,d0        ;check if 68060
  31.     btst    #AFB_68060,d1
  32.     beq.b    .040
  33.     btst    #AFB_FPU40,d1
  34.     bne.b    .040
  35.     bra.b    .End
  36.  
  37. .040    move.l    #68040,d0        ;check if 68040
  38.     btst    #AFB_68040,d1
  39.     beq.b    .030
  40.     bra.b    .End
  41.  
  42. .030    move.l    #68030,d0        ;check if 68030
  43.     btst    #AFB_68030,d1
  44.     beq.b    .020
  45.     bra.b    .End
  46.  
  47. .020    move.l    #68020,d0        ;check if 68020
  48.     btst    #AFB_68020,d1
  49.     beq.b    .010
  50.     bra.b    .End
  51.  
  52. .010    move.l    #68010,d0        ;check if 68010
  53.     btst    #AFB_68010,d1
  54.     beq.b    .000
  55.     bra.b    .End
  56.  
  57. .000    move.l    #68000,d0        ;it's a 68000
  58.  
  59. .End    move.l    (sp)+,a6
  60.     rts
  61. *╗╗╗╗╗╗╗╗╗╗╗╗╗╗╗╗╗╗╗╗╗╗╗╗╗╗╗╗╗╗╗╗╗╗╗╗╗╗╗╗╗╗╗╗╗╗╗╗╗╗╗╗╗╗╗╗╗╗╗╗╗╗╗╗╗╗╗╗╗╗╗╗╗╗╗╗*
  62. And this routine is to check for which math-processor currently installed:
  63.  
  64. Usage:    bsr.b    GetMath
  65.     d0=fpu
  66.  
  67.  
  68. GetMath    move.l    a6,-(sp)        ;GetMath() ()
  69.  
  70.     move.l    $4.w,a6
  71.     move.w    296(a6),d1
  72.  
  73. .040    move.l    #68040,d0        ;check if FPU40 (only on 040/060)
  74.     btst    #AFB_FPU40,d1
  75.     beq.b    .882
  76.     bra.b    .End
  77.  
  78. .882    move.l    #68882,d0        ;check if 68882
  79.     btst    #AFB_68882,d1
  80.     beq.b    .881
  81.     bra.b    .End
  82.  
  83. .881    move.l    #68881,d0        ;check if 68881
  84.     btst    #AFB_68881,d1
  85.     beq.b    .0
  86.     bra.b    .End
  87.  
  88. .0    moveq    #0,d0            ;no FPU
  89.  
  90. .End    move.l    (sp)+,a6
  91.     rts
  92.  
  93.  
  94. Hope this will help.
  95.  
  96.  
  97. ---
  98. CREATIVE LINKS                       __     Kenneth C. Nilsen
  99. http://www.norconnect.no/~kenneth   /_/\    e-mail: kenneth@norconnect.no
  100. "Everything you want"               \_\/    Software & MultiMedia developer
  101.  
  102.